/**
 *
 * @param x 左上角坐标x
 * @param y 左上角坐标y
 * @param width 宽度
 * @param height 高度
 */
export default function getAnchor(
  x: string,
  y: string,
  width: string,
  height: string
) {
  const left = {
    cx: x,
    cy: (Number(height) / 2 + Number(y)).toString(),
  };
  const right = {
    cx: (Number(x) + Number(width)).toString(),
    cy: (Number(height) / 2 + Number(y)).toString(),
  };
  const top = {
    cx: (Number(width) / 2 + Number(x)).toString(),
    cy: y,
  };
  const bottom = {
    cx: (Number(width) / 2 + Number(x)).toString(),
    cy: (Number(height) + Number(y)).toString(),
  };
  return {
    left,
    right,
    top,
    bottom,
  };
}
